package com.doudou.pay.helper.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.doudou.pay.helper.domain.GetOrdersDo;
import com.doudou.pay.helper.service.OrderService;

/**
 * Created by xl on 2018/10/8.
 */
@Controller
@RequestMapping("/order")
public class OrderController {

	@Autowired
	private OrderService orderService;

	@RequestMapping(value = "/list", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE
			+ ";Charset=UTF-8")
	@ResponseBody
	public GetOrdersDo orderList(HttpServletRequest request,
			@RequestParam(value = "page") long page,
			@RequestParam(value = "limit") long limit) {
		return orderService.orderList(page, limit);
	}
}
